package cn.jsu.oj.dispatchServer.satellite.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * netty参数配置
 *
 * @author shan
 * @date 2022/07/01
 */
@Slf4j
@Configuration
@ConfigurationProperties(prefix = "netty")
public class NettyParamConfig {

    /**
     * netty服务端ip
     */
    private String ip;

    /**
     * netty服务端端口
     */
    private Integer port;
    
    /**
     * netty服务端最大入站量
     */
    private Integer sizeIn;

    /**
     * netty服务端最大出站容量
     */
    private Integer sizeOut;

    public NettyParamConfig() {
        log.info("conf: 连接参数配置完成......");
    }

    public NettyParamConfig(String ip, Integer port, Integer sizeIn, Integer sizeOut) {
        this.ip = ip;
        this.port = port;
        this.sizeIn = sizeIn;
        this.sizeOut = sizeOut;
    }

    public NettyParamConfig(Integer port, Integer sizeIn, Integer sizeOut) {
        this.port = port;
        this.sizeIn = sizeIn;
        this.sizeOut = sizeOut;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Integer getSizeIn() {
        return sizeIn;
    }

    public void setSizeIn(Integer sizeIn) {
        this.sizeIn = sizeIn;
    }

    public Integer getSizeOut() {
        return sizeOut;
    }

    public void setSizeOut(Integer sizeOut) {
        this.sizeOut = sizeOut;
    }

    @Override
    public String toString() {
        return "NettyStartConfig{" +
                "ip='" + ip + '\'' +
                ", port='" + port + '\'' +
                ", sizeIn='" + sizeIn + '\'' +
                ", sizeOut='" + sizeOut + '\'' +
                '}';
    }
}
